{% extends 'layout.html' %}
{% block content %}
    <div>
        <div class="container">
            <a href="/user/add/" class="btn btn-primary"> <span class="glyphicon glyphicon-plus"
                                                                aria-hidden="true"></span> 增加用户</a>
            <a href="/user/model/form/add/" class="btn btn-primary"> <span class="glyphicon glyphicon-plus"
                                                                aria-hidden="true"></span> Model form增加用户</a>
            <div class="bs-example" data-example-id="simple-table">
                <table class="table table-bordered">
                    <caption><span class="glyphicon glyphicon-list" aria-hidden="true"></span> 部门列表</caption>
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>姓名</th>
                        <th>密码</th>
                        <th>年龄</th>
                        <th>工资</th>
                        <th>入职时间</th>
                        <th>性别</th>
                        <th>部门</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for item in user_set %}
                        <tr>
                            <th scope="row">{{ item.id }}</th>
                            <td>{{ item.name }}</td>
                            <td>{{ item.password }}</td>
                            <td>{{ item.age }}</td>
                            <td>{{ item.account }}</td>
                            <td>{{ item.create_time|date:'Y-m-d' }}</td>
                            <td>{{ item.get_gender_display }}</td>
                            <td>{{ item.depart.title }}</td>
                            <td>
                                <a class="btn btn-success" href="/user/{{ item.id }}/update/">编辑</a>
                                <a class="btn btn-danger" href="/user/{{ item.id }}/delete/">删除</a>
                            </td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>

                    <ul class="pagination" style="float: left">
                {{ page_str }}

            </ul>
        </div>
    </div>
{% endblock %}